<template>
  <div class="admin-manage-paeg">
    <el-card class="box-card" style="width: 100%; border: none;" shadow="never">
      <div>
        <el-button size="small" type="primary" icon="el-icon-plus" @click="userVisible =true">添加用户</el-button>
      </div>
      <el-table
        :data="tableData"
        style="width: 100%; margin-top: 20px"
        stripe
        tooltip-effect="dark"
        @selection-change="handleSelectionChange"
      >
        <el-table-column
          label="名称"
          prop="name"
        />
        <el-table-column
          label="手机号"
          prop="name"
        />
         <el-table-column
          label="角色"
          prop="name"
        />
        <el-table-column
          label="创建时间"
          prop="name"
        />
        <el-table-column
          label="修改时间"
          prop="name"
        />

        <el-table-column
          align="center"
          fixed="right"
          label="操作"
          width="180"
        >
          <el-button
            size="mini"
            type="primary"
            plain
            @click="userEdit(scope)"
          >编辑</el-button>

          <!-- <el-button
            size="mini"
            type="danger"
            @click="openAdjudication(scope)"
          >冻结</el-button> -->
        </el-table-column>
      </el-table>

      <el-pagination
        background
        layout="prev, pager, next"
        :total="100"
        style="margin-top: 20px"
      />
    </el-card>

    <el-dialog :title="currentUser ? '编辑管理员' : '新增管理员'" width="400px" :visible.sync="userVisible">
      <el-form size="small" label-position="right" :model="userForm" label-width="70px" label-suffix="：">
        <el-form-item label="昵称">
          <el-input
            v-model="userForm.id"
            placeholder="请输入昵称"
          />
        </el-form-item>

        <el-form-item label="手机号">
          <el-input
            v-model="userForm.id"
            placeholder="请输入名字"
          />
        </el-form-item>

        <el-form-item label="密码">
          <el-input
            v-model="userForm.id"
            placeholder="请输入名字"
          />
        </el-form-item>

        <el-form-item label="角色">
          <el-select v-model="userForm.id" placeholder="请选择" style="width: 100%">
            <el-option
              v-for="item in roleList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="userSubmit">保存</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>

    </el-dialog>

  </div>
</template>

<script>

export default {
  name: 'AdminManage',
  data() {
    return {
      roleList: [
        {
          value: '0',
          label: '0'
        }, {
          value: '1',
          label: '1'
        }, {
          value: '2',
          label: '2'
        },
        {
          value: '3',
          label: '3'
        }
      ],
      tableData: [
        { name: '123', id: 1 },
        { name: '123', id: 1 }
      ],
      userVisible: false,
      userForm: {
        id: '1'
      },
      currentUser: null
    }
  },
  computed: {
  },
  mounted() {
  },
  methods: {
    userEdit(item) {
      this.userVisible = true
      this.currentUser = item
    },
    userSubmit() {

    }
  }
}
</script>

<style lang="scss" scoped>
.admin-manage-paeg{
  width: 100%;
}
</style>
